package org.xshop.web.biz;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.xshop.model.TExpressmanHelp;
import org.xshop.service.ITExpressmanHelpService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import top.ibase4j.core.base.AppBaseController;
import top.ibase4j.core.util.WebUtil;

/**
 * <p>
 * 骑手帮助  前端控制器
 * </p>
 *
 * @author ShenHuaJie
 * @since 2018-05-30
 */
@Controller
@RequestMapping("/expressmanHelp")
@Api(tags = "ExpressmanHelp", value = "骑手帮助接口", description = "骑手帮助接口")
public class TExpressmanHelpController extends AppBaseController<TExpressmanHelp, ITExpressmanHelpService> {
    @RequiresPermissions("expressmanHelp.read")
    @PutMapping(value = "/read/list")
    @ApiOperation(value = "查询骑手帮助", produces = MediaType.APPLICATION_JSON_VALUE)
    public Object query(HttpServletRequest request) {
        Map<String, Object> param = WebUtil.getParameter(request);
        return super.query(param);
    }

    @RequiresPermissions("expressmanHelp.read")
    @PutMapping(value = "/read/detail")
    @ApiOperation(value = "骑手帮助", produces = MediaType.APPLICATION_JSON_VALUE)
    public Object get(HttpServletRequest request) {
        TExpressmanHelp param = WebUtil.getParameter(request, TExpressmanHelp.class);
        return super.get(param);
    }

    @PostMapping
    @RequiresPermissions("expressmanHelp.update")
    @ApiOperation(value = "修改骑手帮助", produces = MediaType.APPLICATION_JSON_VALUE)
    public Object update(HttpServletRequest request) {
        TExpressmanHelp param = WebUtil.getParameter(request, TExpressmanHelp.class);
        return super.update(param);
    }

    @DeleteMapping
    @RequiresPermissions("expressmanHelp.delete")
    @ApiOperation(value = "删除骑手帮助", produces = MediaType.APPLICATION_JSON_VALUE)
    public Object del(HttpServletRequest request) {
        TExpressmanHelp param = WebUtil.getParameter(request, TExpressmanHelp.class);
        return super.delete(param);
    }
}